#pragma once
#include <noise/PerlinNoise.hpp>
#include <geometry/Block.h>
#include <glm/glm.hpp>




namespace ChunkGenerator
{

using ChunkBlocksVector = vector<vector<vector<BlockBase* >>>;

class Generator
{
private:
    static siv::PerlinNoise RiverPerlinNoise;
public:
    Generator(uint32_t seed = 0):Seed(seed) {};
    const int SeaLevelHeight = 64; 
    uint32_t Seed = 0;
    virtual void Generate(ChunkBlocksVector& blocks,int ChunkX, int ChunkY) = 0;
    // float GenerateRiverNoise(glm::ivec2 pos);
    float GenerateRiverNoise(int x, int y);
    virtual ~Generator() = default;
};

Generator * CreateGenerator(uint32_t seed ,uint32_t chunkType);



class Plain : public Generator
{
private:
    siv::PerlinNoise HeightPerlinNoise;
    Plain(uint32_t Seed);

public:
    ~Plain() = default;
    void Generate(ChunkBlocksVector& blocks,int ChunkX, int ChunkY) override; 
    static Plain * Instance(uint32_t seed = 0)
    {
        static Plain instance(seed);
        return &instance;
    }


    uint8_t GenerateAltitude(int x, int y);
    uint8_t GenerateAltitude(glm::ivec2 pos){
        return this->GenerateAltitude(pos.x, pos.y);
    }
};

}//namespace ChunkGenerator


    









